TMCEnhancedListBox
TMCEnhancedListBox Component

See also	Properties	Methods	Events

This Delphi VCL component eases the hassle of neatly aligning text in list boxes. Just place as many labels as you need (up to 10) over this component, and select the "SmartGrab" choice on the popup menu. Or select the Edit option to pick the labels you want yourself.

One important note about the SmartGrabber: ALL labels youve placed above the listbox HAS to have the EXACT SAME Top value, as this is what the component uses to distinguish labels to include in its search. The easiest way to ensure this is to use Edit|Align.

If you use one or the other of the above techniques, you can use this listbox without being aware of the Label properties, it is taken care of by the component editor.

The text that is to be displayed in the listbox has to be split into pieces with the Separator character, to facilitate easy and quick parsing at runtime.


Ordering information

Version history

Contacting the author


TMCEnhancedListBox properties
Properties

Runtime only	Key proerty

		Align			Hint			PartString
		BorderStyle			InhibitRefresh			PartX
		Canvas			IntegralHeight			PopupMenu
		´Clip			ItemHeight			SelCount
		Color			Items			Selected
		Ctl3D			Label			Separator
		Cursor			Labels			ShowHint
		DragCursor			MultiSelect			Sorted
		DragMode			Name			Style
		Enabled			ParentColor			TabOrder
		ExtendedSelect			ParentCtl3D			TabStop
		Font			ParentFont			TopIndex
		HelpContext			ParentShowHint


Clip property

Declaration:
property Clip: boolean;

Description:

When this property is set, text in the listbox is clipped to the length of the corresponding labels, meaning that youve got to set the labels to the width you want in the listbox.


InhibitRefresh property

Declaration:

property InhibitRefresh: boolean;

Description:

This property is runtime-only and is used to prevent flickering when updating more than one label. Use it with care, ALWAYS inside a try/finally block, so that your listbox wont be left in this state for eternity!


Label property

Declaration:

property Label1: TLabel;

property Label2: TLabel;

property Label3: TLabel;

.

.

.

property Label10: TLabel;

Description:

There are ten properties, named Label1, Label2, and so on up to Label10. These properties govern the positioning of one listbox column each. If a Label is not assigned, the next label is used. There is no way for the component to know when you move a Label associated with it, so you have to choose Refresh from the popup menu to show the new look youve just created.

Instead of using this property, however, you can use the commands on the popup menu - they do all this automatically.


Labels property

Declaration:

property Labels[Index: integer]: TLabel;

Description:

This runtime-only property gives you access to the labels associated with the listbox as an indexed array of TLabels. we provided it for the situations when you create a form at runtime, and want to set the labels associated with the listbox..


PartString property

Declaration:

property PartString[ItemNo, PartNo: integer]: string;

Description:

This property, along with the PartX property, is primarily used for owner-drawn listboxes, to get at the string at a certain position in the item. If you have an item that looks like Hello|World and Separator is |, PartString[ItemNo, 2] would return World. From this it also should be clear that the parts are numbered started at 1, mainly because we think that is more natural and it doesnt matter to the computer.


PartX property

Declaration:
property PartX[PartNo: integer]: integer;

Description:

This property, along with the PartString property, is primarily used for owner-drawn listboxes, to get the position for the part, determined by its corresponding label. The items are numbered starting from 1, for the reasons outlined in the description for PartString. The value is relative to the leftmost edge of the listbox.


Separator property

Declaration:

property Separator: string;

Description:

This property is used in the parsing of the strings into the parts displayed. The whole string is needed to separate the parts, so be careful if you use more than one character here! The default value, #9 (a tab character) isnt used very often because it isnt properly expanded by the Delphi list boxes, and is thus a suitable candidate for separating the parts.


TMCEnhancedListBox methods
Methods

Create

Destroy

Clear

ItemAtPos

ItemRect


TMCEnhancedListBox Events
Events

OnClick	OnEndDrag	OnKeyUp
OnDblClick	OnEnter	OnMouseDown
OnDragDrop	OnExit	OnMouseMove
OnDragOver	OnKeyDown	OnMouseUp
OnDrawItem	OnKeyPress


Ordering information

The registration fee for the component is $20 without source and $40 with source. This is for electronic registration only, you have to supply us with an electronic address (CompuServe, InterNet or FidoNet) to which we can send the registered version. If you want a disk, contact us!

Whatever way you do it, you receive the same benefits - a version that works outside the IDE. In addition your conscience will stop hurting, and youll be able to distribute programs using the component (unregistered version requires Delphi to be running).

You can register this pack in four ways:

CompuServe SWREG, register  #10732 (without source, $20) or #10733 (includes source, $40)

Sending check or money order drawn on a Swedish bank

Sending cash in an envelope (if you dare)

Direct bank transfer, using the below information:

Account 8313-9 3.441.335-1

Kristianstads Sparbank

Via SwedBank, Stockholm

Swift Code SWEDSESS

Our mailing adress is as follows (see Contacting the author for other addresses)

MegaComm HB
Att Christian Tiberg

V Storgatan 67A

S-291 53  Kristianstad

SWEDEN


TMCEnhancedListBox verson history
Version history

0.01	First limited beta release

0.02	Added Methods to the help file

0.03	Added ed_ footnotes to the help file - undocumented by Borland…

1.00	First official release

2.00	Clip property added, Delphi 2.0 version available


Contacting the author

We can be reached through a lot of methods and addresses:

InterNet: megacomm@algonet.se

CompuServe: 100777,2775

FidoNet: 2:200/602

Phone: +46-44-103435

Fax: +46-44-248874

BBS: +46-44-125230

Snail mail:	MegaComm HB

Att Christian Tiberg

V Storgatan 67A

S-291 53  Kristianstad

SWEDEN